/**
 *  system.cpp
 *  ASEngine
 *
 *	Date: 07/08/2013
 *
 *	Language: C++
 *
 *  @author Carl McCaffrey
 *
 */
#include "system.h"

#include "renderer/window.h"

Window window;

void System::Init(HINSTANCE* hinstance, float resX, float resY, unsigned int flags)
{
	XMFLOAT2 size(resX, resY);
	window.Create(hinstance, size, WINDOW);
	window.SetTitle("ASEngine");
}

void System::Shutdown(void)
{
	window.Destroy();
}

bool System::Update(void)
{
	MSG msg;
	while(PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
	{
		if(msg.message == WM_QUIT){
			return false;
		}else{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
	}
	return true;
}
